package com.spi.listener;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(topic = "${rocketmq.consumer.group1.topic}",
consumerGroup = "${rocketmq.consumer.group1.consumer-group}",
        maxReconsumeTimes = 3)
@Component
public class Topic1Listener implements RocketMQListener {
    @Override
    public void onMessage(Object o) {
        try {
            System.out.println("消费者组survey-group1 即将进行消费。。。。");
            throw new Exception("手动抛异常。。。");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
